<template>
  <view>
    <view class="colorB" style="padding:30rpx;" v-for="(item ,index) in whitelistList" :index="index" :key="index">
      <view class="mainColor border-10" style="border: 1px solid #fff;">
        <view class=" padding-10">会员id：{{item.memberId}}</view>
        <view class=" padding-10">手机号：{{item.mobileNumber}}</view>
        <!--   <view class=" padding-10">操作：
          <text style="color: aqua;margin-right: 20rpx;" v-if="checkPermi(['pile:whitelist:edit'])">修改</text>
          <text style="color: aqua;" v-if="checkPermi(['pile:whitelist:remove'])">删除</text>
        </view> -->
      </view>
    </view>

    <!-- 分页 -->
    <uni-pagination show-icon :page-size="queryParams.pageSize" :current="queryParams.pageNum" :total="total"
      @change="change" />
    <view class="btn-view;mainColor border-10">
      <view class="">
        <text
          class="example-info">当前页：{{ queryParams.pageNum }}，数据总量：{{ total }}条，每页数据：{{ queryParams.pageSize }}</text>
      </view>
      <view class="btn-flex ">
        <button class="button word-btn" hover-class="word-btn--hover" :hover-start-time="20" :hover-stay-time="70"
          @click="add"><text class="word-btn-white">增加10条数据</text></button>
        <button class="button" type="default" @click="reset" style="margin-left: 40rpx;">重置数据</button>
      </view>
    </view>
  </view>
</template>

<script>
  import {
    checkPermi,
    checkRole
  } from "@/utils/permission";
  import {
    listWhitelist,
  } from "@/api/pile/whitelist";
  export default {
    props: ['stationId'],
    data() {
      return {
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        // 站点白名单表格数据
        whitelistList: [],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          stationId: this.stationId,
          memberId: null,
          mobileNumber: null,
        },
        // 表单参数
        form: {},
        // 表单校验
        rules: {}
      };
    },
    methods: {
      checkPermi,
      checkRole,
      add() {
        this.queryParams.pageSize += 10
        this.getList();
      },
      reset() {
        this.queryParams.pageSize = 10
        this.queryParams.pageNum = 1
        this.getList();
      },
      change(e) {
        console.log(e.current);
        this.queryParams.pageNum = e.current
        this.getList()
      },
      payMode(sim) {
        payMode.then(result => {
          this.payModeList = result
        })
        let str = this.payModeList.find(item => item.dictValue == sim)
        if (str == undefined) {
          return '一'
        } else {
          return str.dictLabel
        }
      },
      payStatus(sim) {
        payStatus.then(result => {
          this.payStatusList = result
        })
        let str = this.payStatusList.find(item => item.dictValue == sim)
        if (str == undefined) {
          return '一'
        } else {
          return str.dictLabel
        }
      },
      startMode(sim) {
        startMode.then(result => {
          this.startModeList = result
        })
        let str = this.startModeList.find(item => item.dictValue == sim)
        if (str == undefined) {
          return '一'
        } else {
          return str.dictLabel
        }
      },
      getList() {
        listWhitelist(this.queryParams).then(response => {
          this.whitelistList = response.rows;
          console.log('whitelistList里面的参数', this.whitelistList)
          this.total = response.total;
        });
      },
    },
    created() {
      this.getList()
    }
  }
</script>

<style lang="scss">

</style>